//
//  SearchBar.swift
//  NetMusic
//
//  Created by gl on 16/2/18.
//  Copyright © 2016年 CoderC. All rights reserved.
//

import UIKit

class SearchBar: UITextField {

    let leftImageView = UIImageView()
    
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        contentVerticalAlignment = UIControlContentVerticalAlignment.Center
        
        leftImageView.image = UIImage(named: "MCSearchBarDefaultIcon")
        leftImageView.contentMode = UIViewContentMode.Center
        leftImageView.bounds.size = CGSizeMake(leftImageView.image!.size.width + 30, leftImageView.image!.size.height)
        
        leftView = leftImageView
        leftViewMode = UITextFieldViewMode.Always
        
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
}
